﻿using System;
using System.Linq;

namespace Calculator
{
    public class Calculator : ICalculator
    {
        public int Add(int x1, int x2, params int[] optionalAddends)
        {
            var optionalAddendsSum = optionalAddends == null ? 0 : optionalAddends.Sum();
            return x1 + x2 + optionalAddendsSum;
        }

        public float Divide(int x1, int x2)
        {
            if (x2 == 0) throw new DivideByZeroException();
            return x1/(float)x2;
        }

        public string GetTextFromScreen()
        {
            throw new NotImplementedException();
        }
    }
}
